package com.zhaowt.controller.advices;

import com.zhaowt.dto.R;
import com.zhaowt.exception.MyBaseException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * created by 赵文韬 on 2022/12/27 16:23
 */
@RestControllerAdvice
public class MyErrorAdvice {
    @ExceptionHandler(MyBaseException.class)
    public R processMyBaseException(MyBaseException e){
        e.printStackTrace();
        return R.getR(e.getCode(),e.getMessage() , null);
    }

}
